If our Linux host is 24 full-day in the boot state, we only need ATD and crond these two services, if our server is not a 24-hour uninterrupted start, then we need anacron help.Anacron can not replace Cron to run a task, but in days or immediately after the start of the Anacron action, it will detect the downtime should be carried out but not the crontab task, an
Guide
In this article, we'll explain Cron and anacron, and show you how to set up Anacron in Linux. We will also compare these two tools.
650) this.width=650; "class=" Alignnone size-full wp-image-75111 "src=" http://www.linuxprobe.com/wp-content/uploads/ 2017/06/33-1.jpg "width=" "height=" "style=" Height:auto;/>Cron in
· Do at once in the future (depending on the atd service)
· Perform cron periodically in the future (depending on the crond Service)
· Cron supplement (executed after startup) anacron (dependent on anacron service)
At:The at command is used to schedule a one-time task within the specified time.
At [-mldv] TIMEOptions and parameters:-M: After the at task is completed, the user is notified by email even if no
Sometimes it is necessary to perform some system maintenance work that is time-consuming and resource-intensive, or some repetitive operations such as daily backups. The best way to do this is to schedule these tasks at a time of minimal system load at night. Crontab, at commands are often used on Linux systems to implement scheduled tasks. Scheduled tasks are divided into one-time scheduled tasks, and recurring scheduled tasks.One-time scheduled task
program works correctly.
The 5,6,7 row is the task that is performed under the default configuration and the most important part of the task configuration.
Format is: Period delay job-identifier Command
The format is divided into four parts: the execution frequency (days), the delay time (minutes), the task description, and the command to be executed.
The first part refers to the number of days of execution, that is, how many days the task is executed, the monthly is performed within one mo
Configuration and Concepts
See this when looking for crontab, both look alike but after understanding the function, discover Annacron is not a cyclic execution of the command, only a scheduled task, and support the minimum granularity is the day. To do the loop we can think of using crontab to combine with it.
Anacron has a self-contained profile, and if you are centos,red hat some of the most common Linux
minutes Execute command
1 1 * Mail my //Every January 1 23:59 send an e-mail to my
3: System configuration file:/etc/crontab
Cron This service reads /etc/crontab and/var/spool/cron data once every minute.
/etc/crontab:Root can edit this file directly to write work
[Email protected] ~]# Cat/etc/crontabShell=/bin/bash
Path=/sbin:/bin:/usr/sbin:/usr/bin
Mailto=root//email to root when there is an error
home=/
# for details see Mans 4 Crontabs
# E
) Security Monitoring: Check trojans on the/var/log/cron line
4) The Week and day and month cannot coexist.
10. anacron: handles the execution of crontab in a Linux system that has not been started for 24 hours. Therefore, anacron cannot specify a proper task to be executed, however, if anacron is triggered on a daily
file every minute, so as long as you edit/etc/crontab this file, and save it, then the cron settings will be automatically executed.Viewing the file will find a path that represents the execution file search path, Mailto=root: For additional stdout, the data will be emailed to the specified user./etc/crontab This file supports two kinds of command release methods:1) instruction type, which is directly followed by instructions2) directory planning, using the Run-parts directive, the script to be
be performed on our machines on time, and how do the tasks in these downtime work? At this point we need to anacron this command to help us run the crontab task when we boot.Anacron exists to handle the crontab of Linux systems that are not 24 hours long.Anacron can not specify when to run a task, but in days or immediately after the start of the Anacron action,
ACPI. Common Operations supported include: "Power Switch", "battery monitoring", "notebook lid switch", "laptop display brightness", "Sleep", "hanging up", and so on.
Linux services ):Anacron, ATD, CronThere is a small difference between these scheduling programs. We recommend that you enable cron. If your computer runs for a long time, you should enable it. For servers, you should have a better understand
.
In CentOS 6.x, Anacron is no longer a service, but a system command
Anacron configuration file:vi /etc/anacrontab
RANDOM_DELAY=45: Maximum random delay
Start_hours_range=3-22:anacron Execution time range is 3:00-22:00
1 5 cron.daily Run-parts--report/etc/cron.daily
7 cron.weekly run-parts--report/etc/cron.weekly
@monthly cron.m
interface. We recommend that you enable it for all Notebook users. Some servers may not needACPI. Common Operations supported include: "Power Switch", "battery monitoring", "notebook lid switch", "laptop display brightness", "Sleep", "hanging up", and so on.
Linux services ):Anacron, ATD, CronSchedulingProgramThere is a small difference. EnableCron. If your computer is running for a long time, you should
Linux System ManagementI. Process Management1. Role of Process Management1) Determine the health status of the server2) View all processes in the system3) Kill the process2. View of the process1) View All processesPS aux view all processes in the systemPs-le viewing all processes in the system-A: Displays all processes of a terminal, except session leader-U: Shows the user and memory usage of the process-X: Show process without control terminal-L: Lon
Linux Tips: use cron and at to schedule jobs in Linux. many management tasks must be executed regularly. These tasks include rotating log files to avoid filling file systems, backing up data, and connecting time servers for system time synchronization. The tutorial mentioned above details this... Linux Tips: using cron and at to schedule jobs on
Description: An automated run task. Red Hat Linux comes with four tools for automating tasks: Cron, Anacron, at, and batch. When your Linux host does not turn on all the time, this anacron can help you perform work that has not been performed during the "crontab" setting. For example, when your host shuts down at 12:0
For details about the Linux system daemon, ntsysv can turn off the services acpid, haldaemon, messagebus, klogd, network, syslogd, and the above services must be enabled! Other analyses are as follows: 1. NetworkManager and NetworkManagerDispatcher NetworkManager are background processes that automatically switch network connections. Many laptop users need to enable this function, which enables you to switch between a wireless network and a wired netw
1.Preparing the installation packagedownload the corresponding Linux version of the RPM installation package address (http://downloads.mysql.com/archives/community/)This example uses a CentOS6.5 Linux . Download the corresponding installation package as follows:650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7E/5D/wKiom1b9F8njDSJNAAG4uyHsi2Y956.png "title=" Qq20160327192444.png "alt=" Wkiom1b9f8
Linux tips: Scheduling jobs with Cron and atOn Linux systems, many administrative tasks must be performed frequently and regularly. These tasks include rotating log files to avoid filling the file system, backing up data, and connecting time servers to perform system time synchronization. The tutorials mentioned above describe these administrative tasks in more detail. In this article, learn about the sched
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.